<!-- 系领导角色学员评教结果查看 -->
<template>
  <div class="wrapper-container" style="width:100%">

    <div class="search-container" style="margin-top:15px">
      <div class="filter-button">
        <ButtonItem @click="radio4 = '查看评教报告单'" :fillFlag="radio4 == '查看评教报告单'" :name="'查看评教报告单'" :link="''" :icon="''"
          :buttonColor="'blue'"></ButtonItem>
        <!-- juese -->

        <!--@click="showSeeDialog = true"-->
      </div>
    </div>


    <div class="table-container">
      <el-table max-height="600" v-if="!isLookR" :data="tableData" :span-method="
        (radio4 == '查看校区分析（专业课通识课分布）' ||
          radio4 == '（查看数据分析）教员平均得分')
          ? arraySpanMethod
          : null
      " style="width: 100%" class="xpaas-table-class" row-class-name="xpaas-row-class"
        cell-class-name="xpaas-cell-class" header-row-class-name="xpaas-header-row-class"
        header-cell-class-name="xpaas-header-cell-class">
        <!-- :summary-method="getSummaries" -->

        <el-table-column v-if="radio4 == '查看校区分析（专业课通识课分布）' || radio4 == '（查看数据分析）专业课'" prop="xueqi" label="年级"
          align="center">
        </el-table-column>
        <el-table-column v-if="radio4 == '（查看数据分析）教员平均得分' || radio4 == '（查看数据分析）通识课'" prop="pjResultCopyList[0].nj"
          label="年级" align="center">
        </el-table-column>
        <el-table-column v-if="radio4 == '（查看数据分析）专业课'" prop="pjEvalactor.classes" label="教学班" align="center">
        </el-table-column>

        <el-table-column v-if="radio4 == '（查看数据分析）专业课'" prop="pjEvalactor.coursename" label="课程名称" align="center">
        </el-table-column>
        <el-table-column v-if="radio4 == '（查看数据分析）专业课'" prop="pjEvalactor.teachername" label="教员" align="center">
        </el-table-column>
        <el-table-column v-if="radio4 == '（查看数据分析）教员平均得分'" prop="pjEvalactor.department" label="系" align="center">
        </el-table-column>
        <el-table-column v-if="radio4 == '（查看数据分析）教员平均得分' || radio4 == '（查看数据分析）通识课' || radio4 == '（查看数据分析）专业课'"
          prop="pjEvalactor.staffroom" label="教研室" align="center">
        </el-table-column>

        <el-table-column v-if="radio4 == '（查看数据分析）专业课'" prop="aug" label="评价得分" align="center">
        </el-table-column>
        <el-table-column v-if="radio4 == '（查看数据分析）教员平均得分' || radio4 == '（查看数据分析）通识课'" prop="pjEvalactor.teachername"
          label="教员" align="center">
        </el-table-column>
        <el-table-column v-if="radio4 == '（查看数据分析）教员平均得分'" prop="pjEvalactor.title" label="职称" align="center">
        </el-table-column>
        <el-table-column v-if="radio4 == '（查看数据分析）教员平均得分'" prop="pjResultCopyList[0].aug" label="平均分" align="center">
        </el-table-column>
        <el-table-column v-if="radio4 == '（查看数据分析）教员平均得分' || radio4 == '（查看数据分析）通识课'" prop="pjEvalactor.coursename"
          label="课程名称" align="center">
        </el-table-column>
        <el-table-column v-if="radio4 == '（查看数据分析）教员平均得分' || radio4 == '（查看数据分析）通识课'" prop="pjEvalactor.classes"
          label="教学班" align="center">
        </el-table-column>
        <el-table-column v-if="radio4 == '（查看数据分析）教员平均得分'" prop="pjResultCopyList[0].aug" label="评价得分" align="center">
        </el-table-column>
        <el-table-column v-if="radio4 == '（查看数据分析）通识课' || radio4 == '（查看数据分析）教员平均得分'"
          prop="pjResultCopyList[0].manypeople" label="评价人数" align="center">
        </el-table-column>
        <el-table-column v-if="
          radio4 == '（查看数据分析）教员平均得分' || radio4 == '（查看数据分析）通识课' || radio4 == '（查看数据分析）专业课'
        " prop="pjResultCopyList[0].dengji" label="评价等级" align="center">
        </el-table-column>
        <el-table-column v-if="radio4 == '（查看数据分析）通识课'" prop="pjResultCopyList[0].aug" label="评价等分" align="center">
        </el-table-column>
        <el-table-column v-if="radio4 == '查看校区分析（分数段分布）'" prop="xueqi" label="学期" width="156" align="center">
        </el-table-column>
        <template v-if="radio4 == '查看校区分析（分数段分布）'">
          <el-table-column v-for="(item, index) in heanderArrgs" :key="index" :label="item.sysIntro" align="center">
            <template slot-scope="scope">
              <div style="display: flex;margin-left: 60px; width: 100px">
                <div class="bk-lucj-import-button">
                  <span>{{ item.num }}</span>
                </div>
              </div>
            </template>
          </el-table-column>
        </template>

        <el-table-column v-if="radio4 == '（查看数据分析）专业课'" prop="manypeople" label="评价人数" align="center">
        </el-table-column>
        <el-table-column v-if="radio4 == '查看校区分析（专业课通识课分布）'" prop="course" label="课型" align="center">
        </el-table-column>
        <template v-if="radio4 == '查看校区分析（专业课通识课分布）'">
          <el-table-column v-for="(item, index) in tskheanderArrgs" :key="index" :label="item.sysIntro" align="center">
            <template slot-scope="scope">
              <div style="display: flex;margin-left: 60px; width: 100px">
                <div class="bk-lucj-import-button">
                  <span>{{
                      scope.row.fenshuduanR ? scope.row.fenshuduanR[index] : ""
                  }}</span>
                  <!-- <span>{{ index  }}</span> -->
                </div>
              </div>
            </template>
          </el-table-column>
          <el-table-column v-for="(item, index) in blheanderArrgs" :key="index" :label="item.sysName" align="center">
            <template slot-scope="scope">
              <div style="display: flex;margin-left: 60px; width: 100px">
                <div class="bk-lucj-import-button">
                  <span>{{
                      scope.row.bili1 ? scope.row.bili1[index] : ""
                  }}</span>
                </div>
              </div>
            </template>
          </el-table-column>
        </template>

        <el-table-column v-if="radio4 == '查看校区分析（专业课通识课分布）'" prop="xiaoji" label="小计" align="center">
        </el-table-column>
        <el-table-column v-if="radio4 == '查看校区分析（分数段分布）'" width="120" prop="courses" label="课程总门数" align="center">
        </el-table-column>
        <el-table-column v-if="radio4 == '查看校区分析（分数段分布）'" prop="firstQuartile" label="第一四分位" align="center">
        </el-table-column>
        <el-table-column v-if="radio4 == '查看校区分析（分数段分布）'" prop="median" label="中位数" align="center">
        </el-table-column>
        <el-table-column v-if="radio4 == '查看校区分析（分数段分布）'" prop="threeQuartile" label="第三四分位" align="center">
        </el-table-column>
        <el-table-column v-if="radio4 == '查看校区分析（分数段分布）'" prop="mode" label="众数" align="center">
        </el-table-column>
        <el-table-column v-if="radio4 == '查看校区分析（分数段分布）'" prop="variance" label="方差" align="center">
        </el-table-column>
        <el-table-column v-if="radio4 == '查看校区分析（分数段分布）'" prop="calibration" label="标准差" align="center">
        </el-table-column>
        <el-table-column v-if="radio4 == '查看校区分析（分数段分布）'" prop="avg" label="平均值" align="center">
        </el-table-column>
      </el-table>
      <el-table max-height="600" v-if="isLookR" :data="tableDataLook" style="width: 100%" class="xpaas-table-class"
        row-class-name="xpaas-row-class" cell-class-name="xpaas-cell-class"
        header-row-class-name="xpaas-header-row-class" header-cell-class-name="xpaas-header-cell-class"
        @selection-change="handleSelectionChange">
        <!-- :summary-method="getSummaries" -->
        <el-table-column width="70" align="center" type="selection"></el-table-column>
        <el-table-column prop="grade" label="年级" align="center">
        </el-table-column>
        <el-table-column prop="department" label="系" align="center">
        </el-table-column>
        <el-table-column prop="staffroom" label="教研室" align="center">
        </el-table-column>
        <el-table-column prop="teachername" label="教员" align="center">
        </el-table-column>
        <!-- <el-table-column prop="pjEvalactor.title" label="职称" align="center">
        </el-table-column>
        <el-table-column prop="pjResult.avgscore" label="平均分" align="center">
        </el-table-column> -->
        <el-table-column prop="coursename" label="课程名称" align="center">
        </el-table-column>
        <el-table-column prop="classes" label="教学班" align="center">
        </el-table-column>
        <!-- <el-table-column prop="pjResult.score" label="评价得分" align="center">
        </el-table-column>
        <el-table-column prop="pjResult.dengji" label="评价人数" align="center">
        </el-table-column>
        <el-table-column prop="pjResult.dengji" label="评价等级" align="center">
        </el-table-column> -->
      </el-table>
    </div>




  </div>
</template>

<script>
import SelectItem from "../../../components/SelectItem.vue";
import InputItem from "../../../components/InputItem.vue";
import ButtonItem from "../../../components/ButtonItem.vue";
import { toSelectList } from "@/api/teacher/admin";
import {
  reqGetXqList,
  getxb,
  getClass,
  queryXBclassroom
} from "@/api/course/courses";
import {
  selectByCourseFenXi,
  selectByObjectFenXi,
  pjselectAugXLD,
  pjselectZuanYeXLD,
  pjselectResult,
} from "@/api/teacher/admin";
import {
  pjevalprojectRemoveupload,
  pjevalprojectupload
} from "../../../api/teacher/admin";
import showYprDialog from "@/views/comonents/showYprDialog";
export default {
  components: {
    SelectItem,
    InputItem,
    ButtonItem,
    showYprDialog
  },
  data() {
    return {
      evalactorid: "",
      showYprDialog: "",
      dialogTitle: "",
      teacherid: "",
      blheanderArrgs: [],
      arrs: [],
      Arrarrs: [],
      heanderArrgs: [],
      tskheanderArrgs: [],
      newMidifyDialog: false,
      newMidifyDialogser: false,

      paperList: [
        {
          title: "试卷A：",
          name: ""
        }
      ],
      namelist: {},
      showSeeDialog: false,
      showMidifyDialog: false,
      Showupto: false,
      midifyDialogtableData: [
        {
          sysName: "分段1",
          sysIntro: ""
        },
        {
          sysName: "分段2",
          sysIntro: ""
        },
        {
          sysName: "分段3",
          sysIntro: ""
        },
        {
          sysName: "分段4",
          sysIntro: ""
        },
        {
          sysName: "分段5",
          sysIntro: ""
        }
      ],
      midifyDialogtab: [
        {
          sysName: "比例",
          sysIntro: ""
        },
        {
          sysName: "比例",
          sysIntro: ""
        },
        {
          sysName: "比例",
          sysIntro: ""
        },
        {
          sysName: "比例",
          sysIntro: ""
        },
        {
          sysName: "比例",
          sysIntro: ""
        }
      ],
      tableChangeFlag: false,
      radio4: this.$route.query.radio4 ? this.$route.query.radio4 : "查看评教结果",
      //专业课通识课选择状态
      coursetype: "查看评教结果",
      semester: "",
      xueqiList: [],
      //系部
      department: "",
      zsxbList: [],
      scaleManya: "",
      scaleManyb: "",
      tablelist: [],
      nums: "",
      staffroom: "",
      gClassList: [],
      teachername: "",
      coursename: "",
      scaleMany: "",
      scaleManys: "",
      zj: "总计",
      zja: "0",
      tableData: [],
      tableDataLook: [],
      current: 1,
      size: 10,
      isLookR: true,
      dataListSelections: [],
    };
  },
  watch: {
    radio4(val) {
      var _this = this;
      console.log(val);
      if (val === "（查看数据分析）专业课" || val === "（查看数据分析）通识课") {
        this.pjselectZuanYe(val);
        this.isLookR = false;
      }
      if (this.radio4 == "（查看数据分析）教员平均得分") {
        this.pjselectAug(val);
        this.isLookR = false;
      }
      if (this.radio4 == "查看校区分析（分数段分布）") {
        this.selectByObjectFenXi(val);
        this.isLookR = false;
      }
      if (this.radio4 == "查看校区分析（专业课通识课分布）") {
        this.selectByCourseFenXi(val);
        this.isLookR = false;
      }
      if (val == "查看评教结果") {
        this.isLookR = true;
        this.selectByObjectStudenIdYes(val);
      }
      if (val == '查看评教报告单') {
        console.log(this.dataListSelections)
        if (this.dataListSelections.length <= 0) {
          this.$message({
            type: 'info',
            message: '请先选择需要查看的对象！'
          })
          this.radio4 == '查看评教结果'
          return
        } else if (this.dataListSelections.length > 1) {
          this.$message({
            type: 'info',
            message: '只允许选择单个对象进行查看！'
          })
          this.radio4 == '查看评教结果'
          return
        } else if (this.dataListSelections.length == 1) {
          this.$router.push({
            path: "/leadership/evaluation/resultReportCard",
            query: {
              id: this.dataListSelections[0].evalactorid
            }
          });
        }
      }
      // this.tableChangeFlag = true;
      window.setTimeout(() => {
        this.mergeRow();
      }, 500);
    },
  },
  computed: {
    config() {
      return {
        mergeTarget: "id", // 通用依据
        combineProp:
          this.radio4 == "查看校区分析（专业课通识课分布）"
            ? [
              // combineProp - 根据mergeTarge 进行合并的单元格属性
              "xueqi"
            ]
            : this.radio4 == "（查看数据分析）教员平均得分"
              ? ["system", "classname", "teacherName", "position"]
              : []
      };
    }
  },

  mounted() {
    this.xbAll();
    this.classAll();
    this.zsxbselset();
    this.getXqList();
    this.mergeRow();
    this.selectByObjectStudenIdYes(this.radio4);
  },

  methods: {
    renew: function (id, name) {
      let obj = {
        evalactorid: this.evalactorid,
        teacherid: id,
        teachername: name
      };
      //修改传值
      return new Promise(() => {
        //网上评教修改保存
        UpdateID(obj).then(res => {
          this.ByIdJueSe();
        });
      });
    },
    showYprDialClick: function (teacherid) {
      this.showYprDialog = teacherid;
    },
    //授权弹窗
    showYprDial(teacherid, evalactorid) {
      this.evalactorid = evalactorid;
      this.dialogTitle = "授权";
      this.showYprDialClick(teacherid);
    },
    //选择对象查看报告单
    handleSelectionChange(val) {
      this.dataListSelections = val;
      // val.forEach((element) => {
      //   newArr.push(element.id);
      // });
      // that.ids = newArr.join(",");
    },
    //设置分数段（数据分析）
    newMidify() {
      console.log(this.semester)
      if (this.semester == '') {
        this.$message({
          type: 'error',
          message: '请先选择学期！'
        })
        return
      }
      this.newMidifyDialog = true;
    },
    //设置分数段（专业课通识课分布）
    newMidifyS() {
      if (this.semester == '') {
        this.$message({
          type: 'error',
          message: '请先选择学期！'
        })
        return
      }
      this.newMidifyDialogser = true;
    },
    async xbAll() {
      const xb = await getxb();
      xb.data.code == 200 ? (this.xbList = xb.data.data) : [];
    },
    async classAll() {
      const gClass = await getClass();
      gClass.data.code == 200 ? (this.gClassList = gClass.data.data) : [];
    },
    // 教研室下拉框的改变
    handleClass(val) {
      if (!val) {
        this.department ? this.handleXb(this.department) : this.classAll();
      }
    },
    // 根据系部选中获取教研室
    async handleXb(val) {
      if (val) {
        const xbClass = await queryXBclassroom(val);
        xbClass.data.code == 200 ? (this.gClassList = xbClass.data.data) : [];
        this.staffroom = ''
      } else {
        this.xbAll();
        this.classAll();
      }
    },
    fsdbcfds() {
      this.tskheanderArrgs = [];
      this.Arrarrs = [];
      console.log(this.midifyDialogtab, "000");
      for (let i = 0; i < this.midifyDialogtab.length; i++) {
        if (this.midifyDialogtab[i].sysIntro != "") {
          this.Arrarrs.push(this.midifyDialogtab[i].sysIntro);
        }
      }

      console.log(this.Arrarrs, "000");
      this.selectByCourseFenXi();

      this.newMidifyDialogser = false;
      //整体分析（分数段）
    },
    bcfds() {
      this.heanderArrgs = [];
      this.arrs = [];
      for (let i = 0; i < this.midifyDialogtableData.length; i++) {
        if (this.midifyDialogtableData[i].sysIntro != "") {
          this.arrs.push(this.midifyDialogtableData[i].sysIntro);
        }
      }
      this.selectByObjectFenXi();
      this.newMidifyDialog = false;
      //整体分析（分数段）
    },
    selectByObjectFenXi() {
      this.heanderArrgs = [];

      let obj = {
        // scale: this.scaleManya+'-'+this.scaleManyb,
        xueqi: this.semester,
        scale: this.arrs.toString()
      };
      return new Promise(() => {
        selectByObjectFenXi(obj).then(res => {
          if (res.data.code == 200) {
            this.tableData = res.data.data;
          }
          let Arrayings = res.data.data;
          console.log(Arrayings, "1111111111");
          for (const item of Arrayings) {
            var arrer = [];
            arrer = item.scaleMany.split(",");
            console.log(arrer, "222222");
            var arrers = [];
            arrers = item.scale.split(",");
            for (let q = 0; q < arrer.length; q++) {
              console.log(arrer[q], "****");
              if (arrer[q] != "") {
                let obj = {
                  sysIntro: arrer[q]
                };

                this.heanderArrgs.push(obj);
              }
            }
            console.log(this.heanderArrgs, "******");
            for (let t = 0; t < this.heanderArrgs.length; t++) {
              this.heanderArrgs[t].num = arrers[t];
            }
          }
          console.log(this.heanderArrgs, "89898989898989898989898");

          for (let t = 0; t < this.midifyDialogtableData.length; t++) {
            this.midifyDialogtableData[t].sysIntro = arrer[t];
          }
        });
      });
    },
    //整体分析通识课专业课
    selectByCourseFenXi() {
      this.tskheanderArrgs = [];
      console.log(this.tskheanderArrgs, "1111*");
      let obj = {
        scale: this.Arrarrs.toString(),
        xueqi: this.semester
      };

      return new Promise(() => {
        selectByCourseFenXi(obj).then(res => {
          if (res.data.code == 200) {
            this.tableData = res.data.data;
            if (this.tableData.length > 0) {
              this.tableData.forEach((res, index) => {
                let arr1 = res.bili1.split(",");
                res.bili1 = arr1;
                let arr2 = res.fenshuduanR.split(",");
                res.fenshuduanR = arr2;
              });
            }
          }
          let Arrayings = res.data.data;
          if (Arrayings.length > 0) {
            var arrer = [];
            this.blheanderArrgs = [];

            arrer = Arrayings[0].fenshuduan.split(",");
            console.log(arrer, "arrer");
            for (let q = 0; q < arrer.length; q++) {
              console.log(arrer[q]);
              if (arrer[q] != "") {
                let obj = {
                  sysIntro: arrer[q]
                };
                this.tskheanderArrgs.push(obj);

                let obj2 = {
                  sysName: "比例"
                };
                this.blheanderArrgs.push(obj2);
              }
            }
            for (let t = 0; t < this.midifyDialogtab.length; t++) {
              this.midifyDialogtab[t].sysIntro = arrer[t];
            }
            this.selectByCourseFenXias();
          }
        });
      });
    },
    //系领导查看评价结果
    selectByObjectStudenIdYes(val) {
      let selectAug = {
        classroom: this.staffroom,
        coursetype: val,
        teachername: this.teacher,
        xibu: this.department,
        xueqi: this.semester,
        coursename: this.coursename
      };
      return new Promise(() => {
        toSelectList().then(res => {
          console.log('获取信息1111', res)
          if (res.data.code == 200) {

            this.tableDataLook = res.data.msg == '暂无承载数据' ? [] : res.data.data
            // this.tableDataLook = res.data.msg == '暂无承载数据' ? [] : res.data.data;
          }
        });
      });
    },
    zsxbselset() {
      getxb().then(res => {
        this.zsxbList = res.data.data;
        console.log(this.zsxbList, "555");
      });
    },
    // 获取学期院历列表
    async getXqList() {
      const result = await reqGetXqList();
      if (result.data.code == 200) {
        this.xueqiList = result.data.data;
      }
    },
    //导入评价报告
    dialogClick() {
      this.showSeeDialog = true;
    },
    getFile(event, reload, index) {
      let file = event.target.files;
      let form = new FormData();
      form.append("file", file[0]);
      form.append("term", this.semester);
      // form.append("position", position);
      console.log(file, reload);
      let el = this;
      return new Promise(() => {
        pjevalprojectupload(form).then(res => {
          if (res.data.code === 200) {
            el.paperList[index].name = file[0].name;
            this.pjselectZuanYe();
            el.$message({
              showClose: true,
              message: "上传成功",
              type: "success"
            });
          } else {
            el.paperList[index].name = "";
            el.$message({
              showClose: true,
              message: "上传失败，请重新上传",
              type: "error"
            });
          }
        });
      });
    },
    deleteFile(index) {
      let form = new FormData();
      // form.append("file", file[0]);
      form.append("term", this.semester);
      // form.append("position", position);
      let el = this;
      return new Promise(() => {
        pjevalprojectRemoveupload(form).then(res => {
          if (res.data.code === 200) {
            el.paperList[index].name = "";
            this.pjselectZuanYe();
            el.$message({
              showClose: true,
              message: "删除成功",
              type: "success"
            });
          } else {
            el.$message({
              showClose: true,
              message: "删除失败，请重新删除",
              type: "error"
            });
          }
        });
      });
    },
    inquireClick() {
      let val = this.radio4;
      if (val === "（查看数据分析）专业课" || val === "（查看数据分析）通识课") {
        this.pjselectZuanYe(val);
      }
      if (this.radio4 == "（查看数据分析）教员平均得分") {
        this.pjselectAug(val);
      }
      if (this.radio4 == "查看校区分析（分数段分布）") {
        this.selectByObjectFenXi(val);
      }
      if (this.radio4 == "查看校区分析（专业课通识课分布）") {
        this.selectByCourseFenXi(val);
      }
      if (val == "查看评教结果") {
        console.log(7878787)
        this.selectByObjectStudenIdYes(val);
      }
    },
    //查询专业课,通识课一个接口
    pjselectZuanYe(coursetype) {
      let obj = {
        classname: this.staffroom,
        coursename: this.coursename,
        coursetype: coursetype,
        teacher: this.teachername,
        xb: this.department,
        xueqi: this.semester
      };
      return new Promise(() => {
        pjselectZuanYeXLD(obj).then(res => {
          if (res.data.code) {
            this.tableData = res.data.data.records;
            // console.log(this.tableData, "911");
          }
        });
      });
    },

    //查询平均分
    pjselectAug(val) {
      let selectAug = {
        classname: this.classname,
        coursetype: val,
        teacher: this.teacher,
        xb: this.xb,
        xueqi: this.semester
      };
      return new Promise(() => {
        pjselectAugXLD(this.current, this.size, selectAug).then(res => {
          if (res.data.code) {
            this.tableData = res.data.data.records;
          }
        });
      });
    },

    // sumItem: function(arr1, arr2) {
    //         if (arr2.length == 0) {
    //             return arr1;
    //         } else {
    //             arr1.map(function(value, index) {
    //                 arr2[index] += Number(value);
    //             })
    //         }
    //         return console.log(arr2);
    //     },
    selectByCourseFenXias() {
      console.log(this.tableData[0]);
      let a = this.tableData[0].fenshuduanR;
      let b = this.tableData[1].fenshuduanR;
      let arrsers = [];
      for (let i = 0; i < a.length; i++) {
        for (let j = i; j < b.length; j++) {
          arrsers.push(Number(a[i]) + Number(b[j]));
          break;
        }
      }
      let c = this.tableData[0].bili1;
      let d = this.tableData[1].bili1;
      let carr = [];
      let darr = [];
      let cdarr = [];
      for (let i = 0; i < c.length; i++) {
        carr.push(c[i].split(".")[0]);
      }
      for (let i = 0; i < d.length; i++) {
        darr.push(d[i].split(".")[0]);
      }
      for (let i = 0; i < carr.length; i++) {
        for (let j = i; j < darr.length; j++) {
          cdarr.push(Number(carr[i]) + Number(darr[j]) + ".00%");

          break;
        }
      }
      console.log(darr);
      var num = 0;
      for (let i = 0; i < this.tableData.length; i++) {
        console.log(Number(this.tableData[i].fenshuduanR));
        num += Number(this.tableData[i].fenshuduanR);
      }
      var nums = 0;
      for (let i = 0; i < this.tableData.length; i++) {
        nums += Number(this.tableData[i].fenshuduanRs);
      }
      var numa = 0;
      for (let i = 0; i < this.tableData.length; i++) {
        numa += Number(this.tableData[i].xiaoji);
      }
      var as = 0;
      for (let i = 0; i < this.tableData.length; i++) {
        as += parseInt(this.tableData[i].bili1);
      }
      var ar = 0;
      for (let i = 0; i < this.tableData.length; i++) {
        ar += parseInt(this.tableData[i].bili2);
      }
      console.log("zja" + as);
      this.tableData.push({
        xueqi: this.zj,
        fenshuduanR: arrsers,
        fenshuduanRs: nums,
        xiaoji: numa,
        bili1: cdarr
      });

      console.log(this.tableData);
    },

    //角色页面的跳转
    juese() {
      this.$router.push("/admin/evaluation/giveRole");
    },

    //发布
    upto() {
      let term = {};
      term = this.semester;
      return new Promise(() => {
        upto(term).then(res => {
          if (res.data.code == 200) {
            if (this.$message.success) {
              this.$message.success("发布成功！");
              this.Showupto = false;
            } else {
              this.$message.success("发布成功！");
            }
          }
        });
      });
    },

    arraySpanMethod({ row, column, rowIndex, columnIndex }) {
      if (
        this.radio4 == "查看校区分析（专业课通识课分布）" &&
        rowIndex == this.tableData.length - 1
      ) {
        if (columnIndex === 0) {
          return [1, 2];
        } else if (columnIndex === 1) {
          return [0, 0];
        }
      }
      const span = column["property"] + "-span";
      if (row[span]) {
        return row[span];
      }
    },
    choiceLink(index) {
      this.record = index;
    },
    checkboxChange(e) {
      console.log(e);
    },

    isEmpty(val) {
      return typeof val == "undefined" || val === null || val == "-";
    },
    isObject(val) {
      return Object.prototype.toString.call(val) === "[object Object]";
    },
    mergeRow() {
      let arr = [].concat(this.tableData);
      // arr.splice(index, 0, Object.assign({}, row))

      this.tableData = this.mergeData(arr);
    },
    mergeData(list) {
      // mergeTarge - 合并项依据
      // combineProp - 根据mergeTarge 进行合并的单元格属性
      return this.filterData(this.config, [].concat(list));
    },
    filterData(config, tableData, targetProp) {
      const { mergeTarget, combineProp } = config;
      // 叠加的合并条件
      combineProp.forEach(column => {
        // 记录合并项
        let combineCount = 1;
        if (this.isObject(column)) {
          return this.filterData.call(this, column, tableData, mergeTarget);
        }
        // 使用倒序遍历
        for (let i = tableData.length - 1; i >= 0; i--) {
          let curr = tableData[i],
            prev = tableData[i - 1];

          if (this.isEmpty(prev)) {
            // 已经循环完毕
            curr[`${column}-span`] = {
              rowspan: combineCount,
              colspan: combineCount >= 1 ? 1 : 0
            };
            break;
          }

          if (
            prev[targetProp] === curr[targetProp] &&
            prev[mergeTarget] === curr[mergeTarget] &&
            prev[`${column}`] === curr[`${column}`]
          ) {
            ++combineCount;
            curr[`${column}-span`] = {
              rowspan: 0,
              colspan: 0
            };
          } else {
            curr[`${column}-span`] = {
              rowspan: combineCount,
              colspan: combineCount >= 1 ? 1 : 0
            };
            prev[`${column}-span`] = {
              rowspan: 1,
              colspan: 1
            };
            // 前后项不相符时，对combinecount进行重置
            combineCount = 1;
          }
        }
      });
      return tableData;
    }
  }
};
</script>
<style lang="less" scoped>
.button-group {
  cursor: pointer;
  margin-top: 50px;
  text-align: center;

  >div {
    display: inline-block;
    font-size: 18px;
    padding: 6px 22px;
    border-radius: 6px;

    &:nth-child(1) {
      color: #f3b815;
      border: 1px solid #f3b815;
      background: #fff6ef;
      margin-right: 139px;
    }

    &:nth-child(2) {
      color: #ff3819;
      border: 1px solid #ff3819;
      background: #ffefef;
    }
  }
}

/deep/.basic-button {
  line-height: 22px;
}

@fontFamily: "Microsoft YaHei";

.xpaas-table-class {
  border: 1px solid #004ca7;
  border-radius: 9px;

  // margin: 15px 0;
  > ::v-deep div.el-table__header-wrapper {
    >table.el-table__header {
      >thead {
        >tr.xpaas-header-row-class {
          padding: 0;
          height: 76px;
          background-color: #edf2f9;
          font-size: 16px;
          font-family: Microsoft YaHei;
          font-weight: bold;
          line-height: 20px;
          color: #004ca7;

          >th.xpaas-header-cell-class {
            font-weight: bold;
            border-right: 1px solid #c7d7eb;
            border-left: 0;
            border-bottom: 1px solid #c7d7eb;
            background-color: #edf2f9;

            >div.cell {
              font-size: 16px;
              font-weight: bold;
              font-family: @fontFamily;
              color: #004ca7;
            }
          }
        }
      }
    }
  }

  > ::v-deep div.el-table__body-wrapper {
    >table.el-table__body {
      >tbody {
        >tr.xpaas-row-class {
          >td.xpaas-header-cell-class {
            border-right: 1px solid #c7d7eb;
            border-left: 0;
            border-bottom: 1px solid #c7d7eb;
            background-color: #edf2f9;

            >div.cell {
              font-size: 16px;
              font-weight: bold;
              font-family: @fontFamily;
              color: #004ca7;
            }
          }

          >td.xpaas-cell-class {
            height: 76px;
            border-right: 1px solid #c7d7eb;
            border-left: 0;
            border-bottom: 1px solid #c7d7eb;

            >div.cell {
              font-weight: normal;
              font-family: @fontFamily;
              color: #004ca7;
            }
          }
        }
      }
    }
  }
}

//导入报告文件
.bottom-block {
  display: flex;
  flex-direction: row;
  justify-content: space-between;

  .export-button {
    width: 127px;
    height: 27px;
    background: #fff6ef;
    border: 1px solid #f3b815;
    border-radius: 4px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    margin-top: 14px;

    >img {
      width: 17px;
      height: 17px;
    }

    >span {
      margin-left: 12px;
      font-size: 14px;
      font-family: Microsoft YaHei;
      font-weight: 400;
      color: #f3b815;
    }
  }

  .text {
    font-size: 14px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    line-height: 39px;
    color: #004ca7;
  }
}

.upload-paper-container {
  .paper-container {
    margin: 0 auto;
    width: 600px;
    height: 200px;
    margin-top: 30px;
    margin-left: 60px;

    .paper-container-row {
      display: flex;
      flex-direction: row;
      align-items: center;
      font-size: 16px;
      font-family: Microsoft YaHei;
      font-weight: 400;
      line-height: 30px;
      color: #004ca7;
      margin-bottom: 35px;

      .title {
        font-size: 22px;
        font-family: Microsoft YaHei;
        font-weight: bold;
        color: #004ca7;
        margin-right: 20px;
      }

      .upload-button {
        width: 100px;
        height: 35px;
        line-height: 30px;
        background: #efebff;
        border: 2px solid #5230e9;
        border-radius: 4px;
        font-size: 20px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        color: #5230e9;
        text-align: center;
        cursor: pointer;
        position: relative;

        input {
          width: 62px;
          position: absolute;
          top: 0;
          right: 0;
          opacity: 0;
        }
      }

      .file-name {
        max-width: 340px;
        margin-right: 10px;
      }

      .scan-button {
        width: 62px;
        height: 28px;
        line-height: 28px;
        background: #fff6ef;
        border: 1px solid #f3b815;
        border-radius: 4px;
        font-size: 16px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        color: #f3b815;
        text-align: center;
        cursor: pointer;
      }

      .download-button {
        .scan-button;
        background: #f1f8fe;
        border: 1px solid #51aef6;
        color: #51aef6;
      }

      img {
        width: 18px;
        height: 19px;
        margin-right: 14px;
      }

      .re-upload-button {
        .upload-button;
        width: 88px;
        color: #02c86c;
        border: 1px solid #02c86c;
        background: #dfffef;

        input {
          width: 80px;
        }
      }
    }
  }

  .paper-container1 {
    width: 100%;
    height: 236px;
    opacity: 1;

    .paper-container-row {
      display: flex;
      flex-direction: row;
      align-items: center;
      font-family: Microsoft YaHei;

      margin-bottom: 35px;
      //border: 1px solid #deb626;

      .paper-container-box1 {
        width: 233px;
        height: 126px;
        background: rgba(0, 76, 167, 0.1);
        opacity: 0.1;
        border-radius: 5px 0px 0px 0px;
        display: flex;
        align-items: center;
        justify-content: center;

        .title {
          width: 90px;
          height: 24px;
          font-size: 18px;
          font-family: Microsoft YaHei;
          font-weight: bold;
          line-height: 20px;
          color: rgba(0, 76, 167, 1);
          opacity: 1;
        }
      }

      .paper-container-box2 {
        margin-left: 15px;
      }

      .upload-button {
        width: 62px;
        height: 28px;
        line-height: 28px;
        background: #efebff;
        border: 1px solid #5230e9;
        border-radius: 4px;
        font-size: 16px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        color: #5230e9;
        text-align: center;
        cursor: pointer;
        position: relative;

        input {
          width: 62px;
          position: absolute;
          top: 0;
          right: 0;
          opacity: 0;
        }
      }

      .file-name {
        max-width: 340px;
        margin-right: 10px;
      }

      .scan-button {
        width: 62px;
        height: 28px;
        line-height: 28px;
        background: #fff6ef;
        border: 1px solid #f3b815;
        border-radius: 4px;
        font-size: 16px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        color: #f3b815;
        text-align: center;
        cursor: pointer;
      }

      .download-button {
        .scan-button;
        background: #f1f8fe;
        border: 1px solid #51aef6;
        color: #51aef6;
      }

      img {
        width: 18px;
        height: 19px;
        margin-right: 14px;
      }

      .re-upload-button {
        .upload-button;
        width: 80px;
        color: #02c86c;
        border: 1px solid #02c86c;
        background: #dfffef;

        input {
          width: 80px;
        }
      }
    }
  }

  .el-dialog__footer {
    padding-bottom: 95px;
  }

  .confirm-button {
    width: 87px;
    height: 36px;
    padding: 0;
    background: #efebff;
    border: 1px solid #5230e9;
    border-radius: 4px;
    font-size: 18px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    color: #5230e9;
    cursor: pointer;
    margin-right: 92px;
  }

  .cancle-button {
    .confirm-button;
    background: #ffefef;
    border: 1px solid #ff3819;
    color: #ff3819;
    margin-right: 0px;
  }

  .download-button {
    .confirm-button;
    background: #f1f8fe;
    border: 1px solid #51aef6;
    color: #51aef6;
    margin-right: 92px;
  }
}

.message-container {
  .message-text {
    >div {
      padding: 57px 0 63px 0;
      font-size: 18px;
      font-family: Microsoft YaHei;
      font-weight: bold;
      line-height: 20px;
      color: #004ca7;
      text-align: center;
    }
  }

  .el-dialog__footer {
    padding-bottom: 95px;
    display: flex;
    justify-content: space-evenly;
  }
}

.search-container {
  justify-content: flex-start !important;
}

.search-button {
  cursor: pointer;
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 27px;
  background: #f1f8fe;
  border: 1px solid #51aef6;
  border-radius: 6px;

  >span {
    font-size: 14px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    color: #51aef6;
  }

  >img {
    width: 19px;
    height: 19px;
    margin-right: 4px;
  }
}

.table-container {
  margin-top: 15px;

  .el-table td,
  .el-table th.is-leaf,
  .el-table--border,
  .el-table--group {
    border-color: #c7d7eb;
  }

  .el-table__header tr,
  .el-table__header th {
    padding: 0;
    height: 76px;
    background-color: #edf2f9;
    font-size: 16px;
    font-family: Microsoft YaHei;
    font-weight: bold;
    line-height: 20px;
    color: #004ca7;
  }

  .el-table__body tr,
  .el-table__body td {
    padding: 0;
    height: 86px;
  }

  .wrapper-button {
    display: flex;
    flex-direction: column;
    align-items: center;

    >div {
      margin-bottom: 8px;
    }
  }
}
</style>

<style lang="less" scoped>
@import "../../../styles/special.less";

.table-container::v-deep .el-table__header th {
  border-color: #c7d7eb !important;
  padding-left: 10px;
}

/deep/.filter-button {
  display: flex;
  justify-content: start;
  line-height: 22px;
}

.filter-button::v-deep .el-radio-button .el-radio-button__inner {
  border-radius: 6px !important;
  border: 1px solid rgb(94, 54, 235);
  color: rgb(94, 54, 235);
  background-color: rgb(235, 228, 254);
}

.filter-button::v-deep .el-radio-button__orig-radio:checked+.el-radio-button__inner {
  border: 1px solid rgb(94, 54, 235);
  color: white;
  background-color: rgb(94, 54, 235);
}

.wrapper-container {
  width: 1711px;
  margin: 0 auto;
}

.table-container {
  margin-top: 15px;

  .table-data {
    width: 100%;
    border: 0.8px solid #004ca7;
    border-radius: 9px;
    font-size: 14px;
    font-family: Microsoft YaHei;
    font-weight: 400;
    color: #004ca7;
  }
}

.save-button {
  width: 87px;
  height: 36px;
  line-height: 36px;
  background: #fff6ef;
  border: 1px solid #f3b815;
  border-radius: 6px;
  font-size: 18px;
  font-family: Microsoft YaHei;
  font-weight: 400;
  color: #f3b815;
  text-align: center;
  margin: 82px auto;
}

.zuoyou {
  width: 200px;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}

/*按钮字体颜色*/
/deep/.filter-button .blue-button a {
  color: #7bbcf8;
  font-size: 12px;
  line-height: 0;
  outline: none;
}

/deep/.filter-button .green-button a {
  color: #02c86c;
  font-size: 12px;
  line-height: 0;
  outline: none;
}

/deep/.filter-button .fillorange-button {
  background-color: #f86900;
}

/deep/.filter-button .orange-button a {
  color: #f86900;
  font-size: 12px;
  line-height: 0;
  outline: none;
}

/deep/.filter-button .yellow-button a {
  color: #f3b815;
  font-size: 12px;
  line-height: 0;
  outline: none;
}

/deep/.filter-button .fillorange-button a {
  color: #fff;
  font-size: 12px;
  line-height: 0;
  outline: none;
}

/deep/.filter-button .fillblue-button a {
  color: #fff;
  font-size: 12px;
  line-height: 0;
  outline: none;
}
</style>
